//
//  zhutiTableViewCell6.m
//  BAOASystem
//
//  Created by michael on 2018/5/21.
//  Copyright © 2018年 czd. All rights reserved.
//

#import "zhutiTableViewCell6.h"

@implementation zhutiTableViewCell6

- (void)awakeFromNib {
    [super awakeFromNib];
     _cyleView = [[collectionviewtwo alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, 150)];

 
    // Initialization code
  
[_cyleView.collectionView reloadData];
}
- (void)layoutSubviews{
 [super layoutSubviews];
 _cyleView.data = _dic[@"pdlt"];
 [self.bomview addSubview:_cyleView];
 NSArray *ctgHotKeyWordListarray = _dic[@"cppdlist"];
 _titlelabel.text= _dic[@"categoryName"];
if(ctgHotKeyWordListarray.count!=0){
[_leftbutton1 setTitle:ctgHotKeyWordListarray[0][@"title"] forState:UIControlStateNormal];
[_leftbutton3 sd_setImageWithURL:[NSURL URLWithString:ctgHotKeyWordListarray[0][@"fileurl"]] forState:UIControlStateNormal];
if (ctgHotKeyWordListarray.count>1) {
[_rightbutton1 setTitle:ctgHotKeyWordListarray[1][@"title"] forState:UIControlStateNormal];
[_rightbutton3 sd_setImageWithURL:[NSURL URLWithString:ctgHotKeyWordListarray[1][@"fileurl"]] forState:UIControlStateNormal];
}
  }
  
  
  
 }
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}



- (IBAction)leftaction3:(id)sender {
NSArray *ctgNewProductListarray = _dic[@"cppdlist"];
NSDictionary *dic =ctgNewProductListarray[0];
if (ctgNewProductListarray.count!=0){
shangpinxqViewController *vc = [[shangpinxqViewController alloc]init];
vc.pdid = dic[@"id"];
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}
}

- (IBAction)leftaction1:(id)sender {
NSArray *ctgNewProductListarray = _dic[@"cppdlist"];
NSDictionary *dic =ctgNewProductListarray[0];
if (ctgNewProductListarray.count!=0){
shangpinxqViewController *vc = [[shangpinxqViewController alloc]init];
vc.pdid = dic[@"id"];
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}
}
- (IBAction)rightbutton1:(id)sender {
NSArray *ctgNewProductListarray = _dic[@"cppdlist"];
NSDictionary *dic =ctgNewProductListarray[1];
if (ctgNewProductListarray.count>1){

shangpinxqViewController *vc = [[shangpinxqViewController alloc]init];
vc.pdid = dic[@"id"];
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}
}



- (IBAction)rightaction3:(id)sender {
NSArray *ctgNewProductListarray = _dic[@"cppdlist"];
NSDictionary *dic =ctgNewProductListarray[1];
if (ctgNewProductListarray.count>1){

shangpinxqViewController *vc = [[shangpinxqViewController alloc]init];
vc.pdid = dic[@"id"];
vc.hidesBottomBarWhenPushed = YES;
[self.ViewController.navigationController pushViewController:vc animated:YES];
}
}


@end
